/**
*   Copyright (C) 2011  Xu Cheng, Yang Zhengyu ,Zuo Zhiheng
*
*   This program is free software: you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation, either version 3 of the License, or
*   (at your option) any later version.
*
*   This program is distributed in the hope that it will be useful,
*   but WITHOUT ANY WARRANTY; without even the implied warranty of
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*   GNU General Public License for more details.
*
*   You should have received a copy of the GNU General Public License
*   along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
///:loadingwidget.cpp
#include "loadingwidget.h"
#include "ui_loadingwidget.h"
#include "../util/Log.h"

LoadingWidget::LoadingWidget (QWidget *parent) :
    QWidget (parent),
    ui (new Ui::LoadingWidget)
{
    ui->setupUi (this);
    ui->label->setText (tr ("Load %1%").arg (QString::number (0)));
    ui->label_2->setText (tr ("Detail:%1").arg (tr("Initial...")));
    ui->progressBar->setValue (0);
}

LoadingWidget::~LoadingWidget()
{
    delete ui;
}

void LoadingWidget::appInitProgress (int percent, QString detail)
{
    Log::v (detail.toStdWString());
    ui->label->setText (tr ("Load %1%").arg (QString::number (percent)));
    ui->label_2->setText (tr ("Detail:%1").arg (detail));
    ui->progressBar->setValue (percent);
}
///:~
